﻿using System;
using System.Collections.Generic;
using Xenta.Attributes;
using Xenta.Entities;

namespace Xenta.Plugins
{
    [Dependency("4eb8df18-2722-4c80-85d6-e12f96dea455",
        Name = "Shipping Not Required")]
    public sealed class NullShippingMethod : IShippingMethod
    {
        #region Methods

        public bool CanShipFrom(IAddress address)
        {
            return true;
        }

        public bool CanShipTo(IAddress address)
        {
            return true;
        }

        public decimal CalcShippingPrice(IAddress from, IAddress to)
        {
            return Decimal.Zero;
        }

        public decimal CalcShippingPrice(OrderEntity order)
        {
            return Decimal.Zero;
        }

        public IDictionary<String, String> InitShipping(OrderEntity order, out string comment)
        {
            comment = String.Empty;
            return null;
        }

        public IDictionary<String, String> CancelShipping(OrderEntity order, out string comment)
        {
            comment = String.Empty;
            return null;
        }

        #endregion
    }

    [Dependency("deb0e748-504a-478d-a7ee-a9ea50964501",
        Name = "Shipment At Own Expense")]
    public sealed class AtOwnExpenseShippingMethod : IShippingMethod
    {
        #region Methods

        public bool CanShipFrom(IAddress address)
        {
            return true;
        }

        public bool CanShipTo(IAddress address)
        {
            return true;
        }

        public decimal CalcShippingPrice(IAddress from, IAddress to)
        {
            return Decimal.Zero;
        }

        public decimal CalcShippingPrice(OrderEntity order)
        {
            return Decimal.Zero;
        }

        public IDictionary<String, String> InitShipping(OrderEntity order, out string comment)
        {
            comment = String.Empty;
            return null;
        }

        public IDictionary<String, String> CancelShipping(OrderEntity order, out string comment)
        {
            comment = String.Empty;
            return null;
        }

        #endregion
    }
}
